package com.github.nuggets.controller;

import com.github.nuggets.model.pojo.LoginAccountInfo;
import com.github.nuggets.model.result.BaseResult;
import com.github.nuggets.model.result.PageResult;
import com.github.nuggets.model.vo.NuggetsAccountDetailVO;
import com.github.nuggets.service.AccountRelationshipService;
import com.github.nuggets.util.LoginAccountUtils;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @description: 登录用户的用户关系相关接口
 * @author: wangsj
 * @date: 2022/3/18 2:40 下午
 */
@RestController
public class AccountRelationshipController {


    @Autowired
    private AccountRelationshipService accountRelationshipService;


    @Operation(summary = "关注列表", description = "用户关注列表")
    @GetMapping("/fouc/{accountId}")
    public BaseResult<PageResult<NuggetsAccountDetailVO>> foucList(
            @PathVariable Long accountId,
            @RequestParam("pageIndex") Integer pageIndex,
            @RequestParam("pageSize") Integer pageSize) {

        return BaseResult.success(accountRelationshipService.foucList(accountId,pageIndex,pageSize));
    }


    @Operation(summary = "粉丝列表", description = "用户粉丝列表")
    @GetMapping("/fans/{accountId}")
    public BaseResult<PageResult<NuggetsAccountDetailVO>> fansList(
            @PathVariable Long accountId,
            @RequestParam("pageIndex") Integer pageIndex,
            @RequestParam("pageSize") Integer pageSize) {

        return BaseResult.success(accountRelationshipService.fansList(accountId,pageIndex,pageSize));
    }


}
